<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            margin: 0;
        }
        .ad{
            background-color: green;
            position: fixed;
            padding: 5px;
            width: 100%;
            height: 50px;
            color: yellow;
            text-align: center;
            line-height: 50px;
        }
        button{
            float: right;
        }
    </style>
</head>
<body>
    <div class="ad">
        python23期皇家赌场开业了,性感荷官在线发牌
        <button id="close">x</button>
    </div>
    <div class='content'>
        我是正文内容
        <img src="0.jpg" alt="">
        <img src="1.jpg" alt="">
    </div>
</body>
<script>
    var btn = document.getElementById('close')
    btn.onclick = function () {
        this.parentNode.style.display = 'none'
    }
</script>
</html>